package com.treasure.mall.biz.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @author allan
 * @date 2019-08-16
 */
@Data
@NoArgsConstructor
public class PageDTO<T> implements Serializable {
    private static final long serialVersionUID = -8445053992033232982L;

    /**
     * 总数量
     */
    private long totalRecords;
    /**
     * 当前页数
     */
    private int pageIndex;
    /**
     * 每页数量
     */
    private int pageSize;
    /**
     * 总页数
     */
    private int totalPages;
    /**
     * 列表
     */
    private List<T> list;

    public PageDTO(long totalRecords, int pageIndex, int pageSize, int totalPages) {
        this.totalRecords = totalRecords;
        this.pageIndex = pageIndex;
        this.pageSize = pageSize;
        this.totalPages = totalPages;
    }
}
